package org.ch00.test11.demo02;

/*
 *
 *@author XCH
 *@date 2025 - 03 - 11 - 20:12
 *
 */
public class MainTest {
    public static void main(String[] args) {
        System.out.println("程序开始");

        // 创建一个共享的 Runnable 实例
        CinemaRunnable ticketRunnable = new CinemaRunnable();

        // 创建三个线程，共享同一个 Runnable 实例
        Thread thread1 = new Thread(ticketRunnable, "售票窗口1");
        Thread thread2 = new Thread(ticketRunnable, "售票窗口2");
        Thread thread3 = new Thread(ticketRunnable, "售票窗口3");

        // 启动线程
        thread1.start();
        thread2.start();
        thread3.start();

        System.out.println("程序结束");
    }
}